package com.token.iot.bratterycharging.gateway.business;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Component;

import com.outstanding.framework.base.SpringContextHolder;
import com.outstanding.framework.core.Logger;
import com.outstanding.framework.core.PendingException;
import com.outstanding.framework.log.LoggerFactory;
import com.token.iot.bratterycharging.gateway.AbstractOper;
import com.token.iot.bratterycharging.gateway.IDGeneration;
import com.token.iot.bratterycharging.gateway.IMEI;
import com.token.iot.bratterycharging.gateway.Oper;
import com.token.iot.bratterycharging.gateway.utils.ByteUtil;

import io.netty.channel.ChannelHandlerContext;

/**
 * 上报整机状态
 * 
 * @author chenzhixuan
 *
 */
@Component("CDLOper")
public class CDLOper extends AbstractOper {

	private static Logger loger = LoggerFactory.getLogger("transactionLogger");

	@Override
	public int onCall(byte[] b, ChannelHandlerContext ctx) throws PendingException {
		String val = new String(b);
		loger.info(" the CDL response =" + val);
		String imei = IMEI.getIMEI(ctx);
		String sessionid = IDGeneration.getSessionID(b);
		String[] params = val.split("#/#");
		for (String str : params) {
			loger.debug("the cdl response pararm="+str);
		}
		return 0;

	}

}
